#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int a = 0;
	int num = 0;
	scanf("%d", &a);
	num = a;
	while (a != 1)
	{
		num += a / 2;
		a = (a / 2) + (a % 2);
	}
	printf("%d\n", num);
	return 0;
}